const { getMyMenus,getOrganizations,getCurrOrgUsers,removeUser} = require("../services/orgService")


module.exports ={
     //获取菜单列表
     myMenus:async (req,res,next)=>{
         let result=await getMyMenus()
         setTimeout(() => {
            res.json(result)
         }, 1500);
     },
     //获取组织
     getOrganizations:async(req,res,next)=>{
        let result=await getOrganizations();
        res.json(result)
     },

     //获取当前组织的所有用户
     getCurrOrgUsers:async(req,res,next)=>{
        let {limit,page,oid,key}=req.query;
        let result=await getCurrOrgUsers(page,limit,oid,key);
        res.json(result)
     },
     //修改用户OUIsInvalid达到伪移除效果
     removeUser:async(req,res,next)=>{
         let {id} = req.body;
         let result=await removeUser(id);
         res.json(result)
     }
}